home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- xheros = _root.ship._x;
- yheros = _root.ship._y;
- x = _root.popo._x;
- y = _root.popo._y;
- if(x < xheros)
- {
- setProperty("_root.popo", _X, x + 7);
- }
- if(xheros < x)
- {
- setProperty("_root.popo", _X, x - 7);
- }
- if(y < yheros)
- {
- setProperty("_root.popo", _Y, y + 7);
- }
- if(yheros < y)
- {
- setProperty("_root.popo", _Y, y - 7);
- }
- if(x < xheros - 4 and y != yheros)
- {
- setProperty("_root.popo", _rotation, 0);
- }
- if(xheros + 4 < x and y != yheros)
- {
- setProperty("_root.popo", _rotation, 180);
- }
- if(this.hitTest(_root.ship))
- {
- tellTarget("_root.energie")
- {
- nextFrame();
- }
- tellTarget("_root.popo")
- {
- gotoAndStop(2);
- }
- }
- else
- {
- play();
- }
- }
-